<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <style>
        #playerTable {
            width: 50%;
            border: 3px solid cadetblue;
            margin: 0px auto;
            text-align: center;
        }

        #playerTable th, td {
            border: 1px solid gray;
        }

        #playerTable img {
            width: 100px;
            height: 100px;
        }
    </style>
    <script src="js/jquery.js"></script>
    <script type="text/javascript">
        $(function () {
            $.ajax({
                type: "GET",
                url: "listPlayers",
                success: function (players) {
                    $.each(players, function (i, e) {
                        $("#playerTable").append('<tr>\n' +
                            '        <td>' + e.uid + '</td>\n' +
                            '        <td>' + e.username + '</td>\n' +
                            '        <td>' + e.password + '</td>\n' +
                            '        <td>' + e.nickname + '</td>\n' +
                            '        <td>\n' +
                            '            <img src="http://192.168.3.5:8090/upload/' + e.photo + '" alt="" src>\n' +
                            '        </td>\n' +
                            '        <td>\n' +
                            '            <a href="fileDownload.do?photo=' + e.photo + '&fileType=' + e.fileType + '">下载</a>\n' +
                            '        </td>\n' +
                            '    </tr>')
                    })
                }
            })
        })
    </script>
</head>
<body>
<table id="playerTable" cellspacing="0xp" cellpadding="0px">
    <tr>
        <th>编号</th>
        <th>用户名</th>
        <th>密码</th>
        <th>昵称</th>
        <th>头像</th>
        <th>操作</th>
    </tr>
</table>
</body>
</html>
